package com.lagou.edu.dao;

import com.lagou.edu.pojo.Auth;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

public interface AuthDao extends JpaRepository<Auth, Integer> {

    @Query("select o from Auth o where o.email = ?1 and ?2 between o.createtime and o.expiretime")
    List<Auth> findByEmailAndExpire(String email, Date expire);

}
